package com.feng.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.feng.entity.Photo;
import com.feng.service.IPhotoService;

@Controller
public class LifeLogController {

	@Autowired
	private IPhotoService photoService;
	
	/**
	 * 生活记录首页
	 * @return
	 */
	@RequestMapping(value="/lifeLogIndex")
	public String lifeLogIndex() {
		return "lifeLog";
	}
	@RequestMapping(value="lifeLogPicIndex")
	public String lifeLogPicIndex(ModelMap modelMap) {
		
		List<Photo> photos = photoService.findAllPhotos();
		modelMap.put("photos", photos);
		return "lifeLogPic";
	}
	
	@RequestMapping(value="lifeLogVideoIndex")
	public String lifeLogVideoIndex() {
		
		return "lifeLogVideo";
	}
}
